package com.rdtravel.services;

import com.rdtravel.entities.DepartureLocation;
import com.rdtravel.entities.Destination;
import com.rdtravel.entities.Trip;
import com.rdtravel.valueobjects.Period;

import java.util.List;

/**
 * Services for {@link com.rdtravel.entities.Trip} Entities
 * 
 * @author Hans
 * 
 */

public interface TripsService {
	/**
	 * 
	 * @param id
	 *            the id of the {@link com.rdtravel.entities.Trip} to find
	 * @return the {@link com.rdtravel.entities.Trip} with this id<br/>
	 *         <code>null</code> if no {@link com.rdtravel.entities.Trip} with
	 *         this id is found
	 */
	Trip findById(long id);

	/**
	 * 
	 * @param destination
	 *            the {@link com.rdtravel.entities.Destination} to which the
	 *            {@link com.rdtravel.entities.Trip} should go
	 * @param departureLocation
	 *            the {@link com.rdtravel.entities.DepartureLocation} from which
	 *            the {@link com.rdtravel.entities.Trip} should start
	 * @param period
	 *            the {@link com.rdtravel.valueobjects.Period} in which the
	 *            {@link com.rdtravel.entities.Trip} should take place
	 * @param seats
	 *            the minimum seats that should be available in the
	 *            {@link com.rdtravel.entities.Trip}
	 * 
	 * @return the {@link com.rdtravel.entities.Trip}s that correspond to these
	 *         criteria
	 */

	List<Trip> findByDestinationAndDepartureLocationAndPeriod(
			Destination destination, DepartureLocation departureLocation,
			Period period, int seats);

	/**
	 * @return the {@link com.rdtravel.entities.Trip}s with a departure date in
	 *         the future
	 */
	List<Trip> findFutureTrips();

	/**
	 * 
	 * @param trips
	 *            the {@link com.rdtravel.entities.Trip}s to import
	 * @throws com.rdtravel.exceptions.TripsToImportInvalidException
	 *             when the trips contain invalid data
	 */
	void importTrips(List<Trip> trips);
}
